package com.lj.msm.controller;

import com.lj.msm.service.MsmService;
import com.lj.msm.utils.RandomUtil;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;


/**
 * @author luojing
 * @version 1.0
 * @date 2021/6/21 11:45
 */
@CrossOrigin
@RequestMapping("/msm")
@RestController
public class MsmController {

    @Autowired
    private MsmService msmService;

    @ApiOperation("发送验证码")
    @PostMapping("/send")
    public Boolean send(String phone){
        //生成6位验证码
        String code = RandomUtil.getSixBitRandom();
        return msmService.send(code, phone);
    }

}




